﻿@{
    Layout = null;
}

<div class="BlockContent Clear">

    <div id="writeComment" class="FormContainer VerticalFormContainer Clear" style="margin-bottom: 25px">
        <dl>
            @if (Session["username"] == null)
            {
                <h3>Bạn cần 
                   <u><a href="javascript:;" onclick="javascript:loadAction('Login','Account')" style="color: #0000CC">đăng nhập</a></u>
                    để đánh giá 
                </h3>
            }
            else
            {
            
                <dt>
                    <span class="span-dt">Tài khoản:</span>
                </dt>
                <dd>
                    <input name="username" type="text" id="username" class="NormalTextBox" 
                                    style="width:250px;" readonly="true" value="@Session["username"]"/></dd>
                <dt>
                    <span class="span-dt">Đánh giá:</span>
                    <span class="star">
                        <div class="starlight" style="width: 65px" id="starlight">
                        </div>
                    </span>
                </dt>
                <dd>
                    <select name="ratePoint" id="ratePoint" class="NormalTextBox" onchange="javascript:starChange()" style="width: 256px;">
                        <option value="5">5 sao (Tốt nhất)</option>
                        <option value="4">4 sao</option>
                        <option value="3">3 sao (Trung bình)</option>
                        <option value="2">2 sao</option>
                        <option value="1">1 sao (Tồi nhất)</option>
                    </select>
                </dd>

                <dt>
                    <span class="span-dt">Lý do đánh giá:</span>
                </dt>
                <dd>
                    <textarea name="opinion" rows="6" cols="20" id="opinion" class="NormalTextBox" style="width: 250px;"></textarea></dd>

@*<dt>
                                <span class="span-dt">Xác nhận</span>
                            </dt>
                            <dd>
                                
                                <div id="recaptcha_div"></div>
                                <script type="text/javascript">showRecaptcha('recaptcha_div');</script>
                                    
                            </dd>*@
                <dt id="gohere">&nbsp;</dt>
                <dd>
                    <a href="javascript:;" onclick="javascript:SendRating()" class="myBtn1">Gửi bình luận của bạn</a>
                </dd>
            }
        </dl>
    </div>
    @{var level = new int[] { 0, 1 };}
    <div class="FormContainer VerticalFormContainer Clear rate-view">
        <dl>
            @foreach (var rate in Model)
            {
                <dt>
                    <strong>@rate.Account.username</strong>
                    Ngày gửi: @rate.rate_date
                </dt>
                <dd>
                    @rate.customer_opinion
                    @if (Session["userLevel"] != null && level.Contains((int)Session["userLevel"]))
                    {
                        <a href="javascript:;" onclick="javascritpt:removeRating(@rate.ID)" class="FloatRight" style="margin-right: 8px;">
                            <img src="/Content/data/icon/cancel-icon.png" height="15" title="Xóa bình luận" /></a>                                                                 
                    }
                    <span class="star">
                        @{var width = 13 * rate.rate; var cssStyle = "width: " + width + "px";}
                        <div class="starlight" style="@cssStyle" >
                        </div>
                    </span>
                    
                </dd>
            }
        </dl>
    </div>

</div>
<div class="Clear"></div>

